/*
 * platform.h
 *
 *  Created on: 03.07.2012
 *      Author: zajost
 */

#ifndef PLATFORM_H_
#define PLATFORM_H_

/* Include the derivative-specific header file */
#include <mc9s08jm60.h>

#define _Stop asm ( stop; )
  /*!< Macro to enter stop modes, STOPE bit in SOPT1 register must be set prior to executing this macro */

#define _Wait asm ( wait; )
  /*!< Macro to enter wait mode */

typedef struct {
    unsigned int  stackFree;                    /* Number of free bytes on the stack                            */
    unsigned int  stackUsed;                    /* Number of bytes used on the stack                            */
} tStackData;


void ClearStack(void);
tStackData CheckStackSize(void);



// Use Project Properties => HCS08 Compiler => Type Sizes to adapt to target
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned int uint16;
typedef signed int int16;
typedef unsigned long uint32;
typedef signed long int32;
typedef char bool;

#define TRUE  1
#define FALSE 0


#define BUSCLOCK    24000000


#define EC_INVALID_CMD      1
#define EC_SUCCESS          0


#endif /* PLATFORM_H_ */
